package com.carvajal.adminpos.views.activities;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.carvajal.adminpos.R;
import com.carvajal.adminpos.controllers.MainController;

public class MainActivity extends Activity {
	
	private Button clientButton;
	private Button supplierButton;
	private Button itemButton;
	private Button userButton;
	private Button commerceButton;
	private Button saleButton;
	private Button purchaseButton;
	/**
	 * Boton de devoluciones 
	 */
	private Button refundButton;
	
	private MainController mainController; 

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		clientButton   = (Button) findViewById(R.id.button_main_client);
		supplierButton = (Button) findViewById(R.id.button_main_supplier);
		itemButton     = (Button) findViewById(R.id.button_main_item);
		userButton     = (Button) findViewById(R.id.button_main_user);
		commerceButton = (Button) findViewById(R.id.button_main_commerce);
		saleButton     = (Button) findViewById(R.id.button_main_sale);
		purchaseButton = (Button) findViewById(R.id.button_main_purchase);
		refundButton   = (Button) findViewById(R.id.button_main_refund);
		
		mainController = new MainController(this);
	}
	
	public void addClientButtonListener(OnClickListener onClickListener) {
		clientButton.setOnClickListener(onClickListener);
	}
	
	public void addSupplierButtonListener(OnClickListener onClickListener) {
		supplierButton.setOnClickListener(onClickListener);
	}
	
	public void addItemButtonListener(OnClickListener onClickListener) {
		itemButton.setOnClickListener(onClickListener);
	}
	
	public void addUserButtonListener(OnClickListener onClickListener) {
		userButton.setOnClickListener(onClickListener);
	}
	
	public void addCommerceButtonListener(OnClickListener onClickListener) {
		commerceButton.setOnClickListener(onClickListener);
	}
	
	public void addSaleButtonListener(OnClickListener onClickListener) {
		saleButton.setOnClickListener(onClickListener);
	}
	
	public void addPurchaseButtonListener(OnClickListener onClickListener) {
		purchaseButton.setOnClickListener(onClickListener);
	}
	
	public void addRefundButtonButtonListener(OnClickListener onClickListener) {
		refundButton.setOnClickListener(onClickListener);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
